package com.lbwnb;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.squareup.picasso.Picasso;

public class MainActivity2 extends AppCompatActivity {
    ImageView p1;
    TextView myTitle;
    TextView myData;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);
        initView();
        initData();
    }

    private void initData() {
        News myNews = (News) (getIntent().getSerializableExtra("myNews"));
        String thumbnail_pic_s = myNews.getThumbnail_pic_s();
        Picasso.with(MainActivity2.this)
                .load(thumbnail_pic_s)
                .transform(new CircleCornerForm())
                .into(p1);
        String title = myNews.getTitle();
        myTitle.setText(title);
        String date = myNews.getDate();
        myData.setText(date);
/*        String thumbnail_pic_s02 = myNews.getThumbnail_pic_s02();
        String thumbnail_pic_s03 = myNews.getThumbnail_pic_s03();
        Picasso.with(MainActivity2.this)
                .load(thumbnail_pic_s02)
                .into(p2);
        Picasso.with(MainActivity2.this)
                .load(thumbnail_pic_s03)
                .into(p3);*/
    }

    private void initView() {
        p1=findViewById(R.id.iv_p1);
        myTitle=findViewById(R.id.tv_title);
        myData=findViewById(R.id.tv_data);
    }
}